from django import http
from django.contrib.auth.mixins import LoginRequiredMixin

# 因为每个函数都要使用前重写 不如直接统一封装
class LoginRequiredJSONMixin(LoginRequiredMixin):
    def handle_no_permission(self):
        return http.JsonResponse({
            "code":400,
            "errmsg":"请先登陆"
        },status=401)